<style type="text/css">
.default {
	margin-bottom:10px;
}
.default tr th, .default tr td {
	padding:1px 10px;
	font-size: small; 
}
.default tr th {
	background:#8D0000 url('/images/penjaga_button.png') repeat-x scroll top left;
	color:#ffffff;
}
</style>

<%= render :partial => "submenu" %>
 
<%= error_messages_for 'user' %>
<% if flash[:message] %> 
		<p style="color: blue;"><%= flash[:message] %></p>
<% end %>
<% if flash[:warning] %> 
	<p style="color: red;"><%= flash[:message] %></p>
<% end %>
<% if flash[:dbnotsycn] %> 
		<p style="color: blue;"><%= flash[:dbnotsycn] %></p>
			ACL list in your Database is not Syncronize with the Controller.
			You Need to update the list in your Database.<br>
			Click Button Bellow
			<% form_for :group, :url=>{:action => 'paddingAclTable'} do |f| %>			
				<%= submit_tag "Update ACL" %>				
			<% end %>
		
<% end %>
<h3>Manage Group Permission</h3>

<% form_for :group, :url=>{:action => 'manage_acl'} do |f| %>
	<%= link_to "Add New Group", {:action => "group_new"} %><br>
	<label>Select Group From The List</label> :
	<%= select("group", "id", @groups.collect {|p| [ p.name, p.id ] },{:include_blank => '[Select Group]'}, { :selected => @groupId.to_i}) %>
	<%= submit_tag "Refresh" %>	
<% end %>
 
<% if !@group.nil? %>
	Description: <span style="background: #F8F8FF">&nbsp;<%= @group.desc %>&nbsp;</span><br/>
	<% str = "Edit Group [" + @group.name.to_s + "]" %> 
	<%= link_to str, {:action => "group_edit", :id => @group.id} %> |
	<%= link_to "Delete ["+@group.name+"]", {:action => "group_delete", :id => @group.id} %>
	<br>
		
		
	
	<% form_for :group, :url=>{:action => 'updateacl'} do |form| %>

		<%= form.hidden_field "id", :size => 20, :value => @groupId %>

		<table class="default" border=0>
		<% @hKontrols.each{|ctl,aktions| %>
			<% if aktions.length > 0 then %>
				<tr>
					<th align=center  colspan=<%= aktions.length + 100%>><%= ctl %></th>
				</tr>
				<tr>
					<% bilRow = 0 %>
					<% aktions.each{|akt,val| %>
					<% bilRow = bilRow + 1 
						if bilRow > 5 then %>
						</td>
						<tr>

					<%		bilRow = 1
						end
				
					%>
						<td align=center ><%= akt %> <br>
						<%= check_box_tag "acl["+ctl+"]["+akt+"]", akt.to_s , @hKontrols[ctl][akt] %> <br>
						 </td>
					<% } %>
				</tr>
			<% end %>
		<% } %>
		</table>
		<label for="group_desc">Group Description: </label>
	
		<%= submit_tag "Submit" %>

	<% end %>
<% end %>

<div style="font-size:x-small;color:white">Greet jijan@https://gallus.honeynet.org.my/</div>
